#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.common.component.service;

import ${package}.common.bean.vo.CodeApiVo;
import ${package}.common.bean.vo.CodeTypeApiVo;
import ${package}.common.bean.vo.JsonResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Description: Code远程调用
 *
 * @author wenxiaopeng
 * @date 2021/06/23 21:49
 *
 * <pre>
 *              ${copyright}
 *      Copyright (c) 2019. All Rights Reserved.
 * </pre>
 */
public interface CodeClient {

	/**
	 * Description:
	 * <查询代码含义>
	 * @param code 1
	 * @author wenxiaopeng
	 * @date 21:53 2021/06/23
	 * @return java.lang.String
	 **/
	@GetMapping(value = "/code/api/meaning/{code}", consumes = "application/json")
	JsonResult<String> meaning(@PathVariable String code);

	/**
	 * Description:
	 * <查询代码树>
	 * @param codeType  代码类型
	 * @param code      子代码
	 * @param lazy      是否懒加载，即是否仅加载子级而不递归加载
	 * @author wenxiaopeng
	 * @date 12:17 2021/06/17
	 * @return ${package}.common.bean.vo.JsonResult<${package}.common.bean.vo.CodeApiVo>
	 **/
	@GetMapping(value = {"/code/api/tree/{codeType}/{code}"}, consumes = "application/json")
	JsonResult<List<CodeApiVo>> getCodesTree(@PathVariable String codeType, @PathVariable(required = false) String code,
	                                    @RequestParam(defaultValue = "false") boolean lazy);

	/**
	 * Description:
	 * <查询代码列表>
	 * @param codeType  代码类型
	 * @param code      子代码
	 * @param lazy      是否懒加载 true时仅返回当前层级
	 * @author wenxiaopeng
	 * @date 12:16 2021/06/17
	 * @return ${package}.common.bean.vo.JsonResult<${package}.common.bean.vo.CodeApiVo>
	 **/
	@GetMapping(value = {"/code/api/list/{codeType}/{code}"}, consumes = "application/json")
	@ApiOperation("查询代码列表")
	JsonResult<List<CodeApiVo>> getCodesList(@PathVariable String codeType, @PathVariable(required = false) String code,
	                                    @RequestParam(defaultValue = "false") boolean lazy);

	/**
	 * Description:
	 * <获取上级代码详情>
	 * @param code 1
	 * @author wenxiaopeng
	 * @date 09:48 2021/06/22
	 * @return ${package}.common.bean.vo.CodeApiVo
	 **/
	@GetMapping(value = "/code/api/upper/{code}", consumes = "application/json")
	JsonResult<CodeApiVo> upperCode(@PathVariable String code);

	/**
	 * Description:
	 * <获取已有代码类型列表>
	 * @author wenxiaopeng
	 * @date 09:48 2021/06/22
	 * @return ${package}.common.bean.vo.CodeVo
	 **/
	@GetMapping(value = "/code/api/types", consumes = "application/json")
	JsonResult<List<CodeTypeApiVo>> getCodeTypeList();
}
